<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>学情管理</title>
	<link rel="stylesheet" href="../css/common2.css">
</head>

<style>
	.search_img {
			position: absolute;
			right: 3%;
		}
		.table {
      table-layout: fixed; /* 固定表格布局 */
      width: 100%; /* 宽度占满父容器 */
  }

  td {
      max-width: 150px; /* 最大宽度 */
      overflow: hidden; /* 隐藏溢出 */
      text-overflow: ellipsis; /* 显示省略号 */
      white-space: nowrap; /* 防止换行 */
  }

  th {
      width: 150px; /* 设置表头列宽 */
  }
  .delete1 {
    /* width: 80px; */
    height: 35px;
    text-align: center;
    font-size: 14px;
    line-height: 35px;
    color: white;
    float: left !important;
    bottom: 50px;
    margin-left: 2%;
    cursor: pointer;
    background: url(../image/enter_long.png) no-repeat center center;
}
.uihf {
			display: flex;
}
		
</style>
<body>

	<div id="vue-root">
		
		<div class="refresh" onclick="location.reload()" v-t="'刷新'"></div>
		
		<input placeholder="请输入学员姓名" class="search" v-model="search.name" style="position: absolute; right: 410px">
		<input placeholder="请输入手机号码" class="search" v-model="search.bindCode" style="height: 33px;">
		<select class="search"  v-model="search.schoolId" style="position: absolute; right: 260px">
			<option :value="undefined">请选择校区</option>
			<option v-for="school in schools" :key="school.id" :value="school.id" v-text="school.name"></option>
		</select>
		
		<img src="../image/search.png" height="35" width="35" alt="" class="search_img" @click="getData0">

		<div class="table">
			<table class="table_top">
				<thead>
					<tr>
						<th>
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th v-t="'序号'"></th>
						<th v-t="'校区'"></th>
						<th v-t="'学员姓名'"></th>
						<th v-t="'电话号码'"></th>
						<th v-t="'性别'"></th>
						<th v-t="'年级'"></th>
						<th v-t="'学习习惯'"></th>
						<th v-t="'家长情况'"></th>
						<th v-t="'辅导建议'"></th>
						<th v-t="'编辑/删除'"></th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(student,index) in list" :key="student.id">
						<td>
							<input type="checkbox" class="check-box" v-model="student.checked">
						</td>
						<td> <span v-text="index+1"></span></td>
						<td v-text="student.schoolName"></td>
						<td v-text="student.name"></td>
						<td v-text="student.bindCode"></td>
						<td v-text="student.sex?'男':'女'"></td>
						<td  v-text="student.gradeName"></td>
						<td :title="student.learningHabit">{{ student.learningHabit }}</td>
						<td :title="student.parentalSituation">{{ student.parentalSituation }}</td>
						<td :title="student.counselingAdvice">{{ student.counselingAdvice }}</td>

						<td>
							<div class="option">
								<div v-if="able.edit" class="edit-icon option-icon">
									<a :href="'xue_qing_management_item.html?id='+student.id"
										style="position: absolute; left: 20%; top: 30%;">
										<img class="img" src="../image/edit.png" height="20" width="20"
											onmouseover="this.src='../image/edit_light.png'"
											onmouseout="this.src='../image/edit.png'" />
									</a>
								</div>
								<div v-if="able.del" class="delete-icon option-icon" @click="del([student.id])"
									style="position: absolute; right: 20%; top: 30%;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='../image/delete_light.png'"
										onmouseout="this.src='../image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<br>
		<div class="delete" @click="batchDelete" v-if="able.del" v-t="'批量删除'"></div>
		<div class="delete1 long-background-img" v-if="able.export" @click="exports">批量导出学情</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
			<li>
				<a v-text="pages"></a>
			</li>
		</ul>
		<div style="float: right;">
			总共{{total}}条记录
			<select class="ui-select init" style="height:32px" v-model="pageSize">
				<option :value="10">每页10条</option>
				<option :value="30">每页30条</option>
				<option :value="100">每页100条</option>
			</select>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script src="/js/auth_util.js"></script>
	<script src="/js/i18n.js"></script>

	<script>
var schoolId = top_params().id;
		setI18n({
			序号: 'No.',
			操作: 'operating',
			年级: 'student',
			添加年级: 'Add grade',
			刷新: 'Refresh',
			批量删除: 'batch deletion'
		});

		var app = new Vue(merge({
			data: {
				urls: {
					del: '/pc/student/delXq'
				},
				schools:[]
			},
			created: function () {
				var schoolId = top_params().id;
				if (!schoolId) {
					alert('未知学校');
					throw '未知学校';
				}
				axios.get('/pc/school/all/' + schoolId).then(function (res) {
						this.schools = res.data;
					}.bind(this));
				this.urls.list = '/pc/learningSituation/list?agentId=' + schoolId;
				this.getData();
				abled('xueQingManagement', this);
			},
			methods:{
				exports: function () {
					var q = Qs.stringify(this.search);
					if (q) q = '&' + q;

					location.href = '/pc/learningSituation/export?agentId=' + schoolId + q;
				},
			},
			i18n: i18n
		}));
	</script>

</body>

</html>